package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.Entity.SetMeal;
import com.sky.annotation.AutoFill;
import com.sky.dto.QuerySetmealByPageDTo;
import com.sky.emumeration.OperationType;
import com.sky.vo.SetmealVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {

    @AutoFill(OperationType.INSERT)
    void insert(SetMeal setMeal);

    Page<SetmealVo> queryByPage(QuerySetmealByPageDTo querySetmealByPageDTo);

    @AutoFill(OperationType.UPDATE)
    void update(SetMeal setMeal);

    SetmealVo queryById(Long id);


    void delete(List<Long> ids);

    @Select("select * from setmeal where category_id=#{categoryId}")
    List<SetMeal> queryByCategoryId(Long categoryId);
}
